package com.xbongbong.paas.pojo.workflow.settings.dto;

import com.xbongbong.paas.config.enums.WorkflowTriggerMethodEnum;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.workflow.pojo.nodes.WorkflowNodePojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * @author 吴峰
 * @date 2021/05/10 15:07
 */
@Setter
@Getter
@ToString
public class WorkflowAddDTO extends BaseDTO {
    private static final long serialVersionUID = 2864757497654446733L;


    /**
     * @see WorkflowTriggerMethodEnum
     */
    private Integer type;
    /**
     * 触发表单应用id
     */
    @NotNull(message = "{dto.msg.appId.NotNull}")
    private Long appId;
    /**
     * 触发表单菜单id
     */
    @NotNull(message = "{dto.msg.menuId.NotNull}")
    private Long menuId;
    /**
     * 触发表单表单id
     */
    @NotNull(message = "{dto.msg.formId.NotNull}")
    private Long formId;
    /**
     * 触发表单saas标识
     */
    @NotNull(message = "{dto.msg.saasMark.NotNull}")
    private Integer saasMark;
    /**
     * 触发表单业务类型
     */
    @NotNull(message = "{dto.msg.businessType.NotNull}")
    private Integer businessType;

    private String name;

    /**
     * 详细触发事件类型 1. 当新增或者更新记录时；2. 仅新增记录时；3.仅更新时；4. 仅删除时；5.阶段推进器
     * @see com.xbongbong.workflow.config.enums.TriggerEventTypeEnum
     *
     */
    @NotNull(message = "{dto.msg.workflowAdd.triggerEventType.NotNull}")
    private Integer triggerEventType;

    /**
     * 触发节点名称
     */
    @Valid
    private WorkflowNodePojo workflowNode;

}
